package com.aaa.arouterone

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import kotlinx.android.synthetic.main.activity_main.*

@Route(path = "/app/main")
class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        initView()
    }

    private fun initView() {
        tv_1.setOnClickListener {
            // 1.应用内简单的跳转(通过URL跳转在'进阶用法'中)
            ARouter.getInstance().build("/module2/main2").navigation()
        }
        button_1.setOnClickListener {
            // 2.跳转并携带参数
            ARouter.getInstance().build("/module3/main3")
                .withString("key3", "888")
                .navigation()
        }
    }
}
